You can't read from a finished program. you have to connect to readyRead();
replace
process->start(cmd,comandlist,QIODevice::ReadOnly ); if (!process->waitForFinished()) { lstr = QString(); } else { lstr = QString(process->readAll().constData()); } return lstr;with
QObject::connect(process,&QProcess::readyReadStandardOutput,[&lstr,process]()->void{lstr.append(QString::fromLatin1(process->readAllStandardOutput()));}); process->start(cmd,comandlist,QIODevice::ReadOnly ); if (process->waitForFinished()) return lstr; return QString();